<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 组合继承=对象冒充+原型继承
        function Person(name,age,sex){
            this.name=name;
            this.age=age;
            this.sex=sex;
        }
        Person.prototype.run=function(){
            console.log("父类的run");
        }

        function Student(num,name,age,sex){
            Person.call(this,name,age,sex);
        }

        Student.prototype=new Person;

        var stu=new Student(123,"海德薇","女",20);
        console.log(stu.name);
        stu.run();

        console.log(stu);
    </script>
</body>
</html>